#include "widget.h"
#include "ui_widget.h"
#include <QMessageBox>


int step = 0;

QString question[] =
{
    "老公的生日是什么时辰",
    "老公的身高是",
    "老公和易烊千玺谁帅",
    "用最美的话语夸赞老公"
};

QString answer1[] =
{
    "A.子时",
    "B.丑时",
    "C.未时",
    "D.酉时"
};

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    dialog = new QDialog(this);//创建对话框对象
    dialogNG = new QDialog(this);


    dialog->setWindowTitle("这你也能错？");
    dialog->resize(200,100);
    dialogNG->resize(200,100);

    connect2Dialog();

}

Widget::~Widget()
{
    delete ui;
    delete dialog;
}



void Widget::Correct()
{
    step++;
}

void Widget::UnCorrect()
{

}

void Widget::connect2Dialog(QPushButton *button)
{
    connect(button,&QPushButton::clicked,dialog,&QDialog::open);
}

void Widget::disconnect2Dialog(QPushButton *button)
{
    connect(buttonError,&QPushButton::clicked,dialog,&QDialog::open);
    connect(buttonTrue,&QPushButton::clicked,dialog,&QDialog::open);
}

void processOn()
{
    while(1);
    {
        switch step
        {
            case 0:
                    connect2Dialog();
            case 1:

            case 2:

            case 3:
                    dialog->setWindowTitle("不够，继续说");
            case 4:
                break;
            default:
                break;
        }

        break;
    }
}
